//
//  BaseNetRequest.h
//  siyanone
//
//  Created by LK-IOS on 2018/3/21.
//  Copyright © 2018年 LK-News. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, RequestType) {
    PostRegister         =10,   //用户注册
    PositionInPositon,         //持仓持仓中
    PositionSettlement,         //持仓结算
    Login,                      //登录
    GetCodeNumber,              //获取验证码
    ModifyPassword,             //修改密码
    GetHomeSaleData,            //首页交易动态
    GetHomeSaleReData,          //首页推荐股票
    GetHomeTopData,             //首页轮播行情公告信息
    AddOptionalStock,           //加自选股票
    DeleteOptionalStock,        //删自选股票
    TopOptionalStock,           //置顶自选股票
    GetMarketData,             //获取大盘行情
    GetOptionalStockList,      //获取自选股票列表
    GetSettingInformationList, //获取设置信息列表
    BindBankCard,              //绑定银行卡
    SettingPaymentPassWord,    //设置支付密码
    BindBankCardList,          //已绑卡列表
    GetKLineData,             //获取K线图数据
    GetStrategyInfo,           //策略类型数据
    BuyStock,                  //点买
    FundDetails,                //资金明细
    FundAccount,                //获取当前账户资金
    GetStockNewMarket,          //获取单只股票最新行情
    UserLogout,                 //退出登录
    CapitalAccountInfo,         //我的持仓
    GetProvincesList,           //获取省份列表
    GetCityLists,               //获取城市列表
    GetBankList,                //获取银行列表
    PromotionInformation,       //获取推广人基本信息
    PromotionLists,             //获取推广人列表
    GetUerInfo,                 //获取用户信息
    WithdrawCash,               //提现
    GetRechargeBankList,       //获取充值银行卡信息列表
    Get2000FreeStrategy,       //2000元体验金
    InitPaymentPassword,       //第一次设置支付密码
    GetNewsListDetail,         //获取资讯列表
    GetCompanyProfile,         //获取公司简介
    GetNewsDetail,             //获取资讯详情
    AlipayForwrad,             //支付宝个人转账
    AllDayNews,                 //24h新闻
    WeekNews,                   //要闻
    WeekNewsDetail,             //要闻详情
    PostJpushId,               //上传极光注册id
    GetMessageList,            //获取消息列表
    GetUnreadMessage,            //获取未读消息
    
    GetHomeTopListKongKe,      //空壳首页Banner列表
    GetAppVersion,             //版本信息
    PostQuickPayMessage,        //快捷支付获取验证码
    PostQuickPay,               //快捷支付
    OptionsCycle,               //期权周期
    OptionsInPositionReword,   //期权持仓记录列表
    OptionOutPositionReword,   //期权结算记录
    OptionsTrade,              //期权认购
    HomeOptionsSaleData,             //期权交易动态
    GetSystemNewTime,          //获取服务器最新事件
    GetCardPay,                //银联支付
    GetJdPay,                  //京东支付
    GetQQpay,                  //qq支付
    GetLianLianPayUrl,        //获取连连支付url
    GetRealName,              //获取有没有实名认证
    PostRealName,             //进行实名认证
    GetAppVersionInformation, //获取app版本信息
    
};

@interface BaseNetRequest : NSObject

@property(nonatomic ,strong) NSString *requestMethod;


//requestMethod   为请求的方式  是get或者post请求
-(id)initWithRequestMethod:(NSString *)requestMethod;


+(void)sessionRequestWithparameters:(NSMutableDictionary *)parameters
                             method:(NSString *)method
                         requstType:(RequestType)type
                   WithSuccessBlock:(void(^)(NSDictionary*resultDict))successBlock
                          failBlock:(void(^)(NSError*error))failBlock;


/**
 
 @param parameters 参数
 @param method  请求方法
 @param type    请求type
 @param successBlock 成功回调
 @param failBlock 失败回调
 */
- (void)sessionRequestWithparameters:(NSMutableDictionary *)parameters
                              method:(NSString *)method
                          requstType:(RequestType)type
                    WithSuccessBlock:(void(^)(NSDictionary*resultDict))successBlock
                           failBlock:(void(^)(NSError*error))failBlock;


/**
 请求方法，无body
 
 @param parameter 参数
 @param urlString 地址
 @param authToken token
 @param successBlock 成功回调
 @param failBlock 失败回调
 */
-(void)sessionRequestWithDictionary:(NSMutableDictionary *)parameter andURLString:(NSString *)urlString andAuthToken:(NSString *)authToken WithSuccessBlock:(void(^)(NSDictionary*resultDict))successBlock failBlock:(void(^)(NSError*error))failBlock;



/**
 请求方法  body
 
 @param parameter 参数
 @param urlString 地址
 @param body body
 @param successBlock 成功回调
 @param failBlock 失败回调
 */
-(void)sessionRequestWithDictionary:(NSMutableDictionary *)parameter andURLString:(NSString *)urlString andBody:(NSString *)body WithSuccessBlock:(void(^)(NSDictionary*resultDict))successBlock failBlock:(void(^)(NSError*error))failBlock;




/**
 请求方法  body  token
 
 @param token token
 @param parameter 参数
 @param urlString 地址
 @param body body
 @param successBlock 成功回调
 @param failBlock 失败回调
 */
-(void)sessionWithToken:(NSString *)token RequestWithDictionary:(NSMutableDictionary *)parameter andURLString:(NSString *)urlString andBody:(NSString *)body WithSuccessBlock:(void(^)(NSDictionary*resultDict))successBlock failBlock:(void(^)(NSError*error))failBlock;


@end
